import 'dart:convert' show json;

class FolderQueryBean {

  int? cursor;
  int? err;
  String? err_msg;
  String? token;
  List<Folder?>? data;

  FolderQueryBean.fromParams({this.cursor, this.err, this.err_msg, this.token, this.data});

  factory FolderQueryBean(Object jsonStr) => jsonStr is String ? FolderQueryBean.fromJson(json.decode(jsonStr)) : FolderQueryBean.fromJson(jsonStr);

  static FolderQueryBean? parse(jsonStr) => ['null', '', null].contains(jsonStr) ? null : FolderQueryBean(jsonStr);

  FolderQueryBean.fromJson(jsonRes) {
    cursor = jsonRes['cursor'];
    err = jsonRes['err'];
    err_msg = jsonRes['err_msg'];
    token = jsonRes['token'];
    data = jsonRes['data'] == null ? null : [];

    for (var dataItem in data == null ? [] : jsonRes['data']){
      data!.add(dataItem == null ? null : Folder.fromJson(dataItem));
    }
  }

  @override
  String toString() {
    return '{"cursor": $cursor, "err": $err, "err_msg": ${err_msg != null?'${json.encode(err_msg)}':'null'}, "token": ${token != null?'${json.encode(token)}':'null'}, "data": $data}';
  }

  String toJson() => this.toString();
}

class Folder {

  int? create_time;
  String? author;
  String? desc;
  String? key;
  String? name;

  Folder.fromParams({this.create_time, this.author, this.desc, this.key, this.name});

  Folder.fromJson(jsonRes) {
    create_time = jsonRes['create_time'];
    author = jsonRes['author'];
    desc = jsonRes['desc'];
    key = jsonRes['key'];
    name = jsonRes['name'];
  }

  @override
  String toString() {
    return '{"create_time": $create_time, "author": ${author != null?'${json.encode(author)}':'null'}, "desc": ${desc != null?'${json.encode(desc)}':'null'}, "key": ${key != null?'${json.encode(key)}':'null'}, "name": ${name != null?'${json.encode(name)}':'null'}}';
  }

  String toJson() => this.toString();
}